import { BrowserRouter, Routes, Route, Navigate, NavLink } from "react-router-dom";

import Home from './home.jsx'
import Crae from './cxt.jsx'
import './app.css'
function App() {
  return (
    <BrowserRouter>
      <div className="App">

        <NavLink to="/home" className={({ isActive }) => isActive ? "aaa" : ""}>首页</NavLink>
        <NavLink to="/crae" className={({ isActive }) => isActive ? "aaa" : ""}>分类</NavLink>
        <div>

          <Routes>
            <Route path="/crae" element={<Crae />} />
            <Route path="/home" element={<Home />} />
            <Route path="/" element={<Navigate to='/home'></Navigate>} />
            <Route path="*" element={<div>404</div>}></Route>
          </Routes>

        </div>
      </div>
    </BrowserRouter>
  );
}

export default App;
